Skip to content

fix: Handle custom AuthInfo format from fee-abstraction reward distribution txs#978

Draft
vNodesV wants to merge 1 commit into
cheqd:mainfrom
vNodesV:fix/authinfo-decoding-feeabs-reward-txs
Draft

fix: Handle custom AuthInfo format from fee-abstraction reward distribution txs#978
vNodesV wants to merge 1 commit into
cheqd:mainfrom
vNodesV:fix/authinfo-decoding-feeabs-reward-txs

Conversation

@vNodesV

@vNodesV vNodesV commented Jul 17, 2026

Copy link
Copy Markdown

Problem

The fee-abstraction module (github.com/cheqd/fee-abstraction/v8 v8.0.3-uneven-heights-formula) creates reward-distribution transactions that embed CustomRewardEntry data where the standard Fee belongs in AuthInfo. The SDK's DefaultTxDecoder calls unknownproto.RejectUnknownFieldsStrict on AuthInfo bytes, which rejects non-standard proto fields. This makes these transactions undecodable for RPC endpoints and block explorers.

Solution

Wraps the standard TxDecoder with CustomTxDecoder that falls back to lenient protobuf decoding when the strict decoder fails on custom AuthInfo fields.

New file: app/tx_decoder.go

  • CustomTxDecoder — tries strict decoder first; falls back to lenient proto.Unmarshal for AuthInfo when RejectUnknownFieldsStrict fails
  • fallbackTx struct — implements sdk.Tx, sdk.FeeTx, sdk.HasValidateBasic, sdk.TxWithMemo, sdk.TxWithTimeoutHeight using lazy codec-based Any resolution, allowing RPC queries and block explorers to read these transactions

Modified: app/app.go

  • Wraps txConfig.TxDecoder() with CustomTxDecoder and passes to baseapp.NewBaseApp

Testing

  • go build ./... passes clean
  • No behavioral change for standard transactions (strict decoder always tried first)

…bution txs

The fee-abstraction module (github.com/cheqd/fee-abstraction/v8)
creates reward-distribution transactions with a custom AuthInfo format
that embeds CustomRewardEntry data where the standard Fee message
belongs. The SDK's DefaultTxDecoder calls
unknownproto.RejectUnknownFieldsStrict on AuthInfo bytes, which rejects
the non-standard proto fields and prevents these transactions from being
decoded for RPC/block explorer queries.

Root cause: proto wire type 1 (fixed64) in the CustomRewardEntry's
validator-hash field is misinterpreted as a Coin denom length prefix
under the standard Fee schema, causing RejectUnknownFieldsStrict to
fail with errUnknownField.

Fix: CustomTxDecoder wraps the standard decoder. When strict decoding
fails, it falls back to lenient gogo/protobuf proto.Unmarshal (which
silently drops unknown fields) for the AuthInfo section. The fallback
wraps the decoded *coretypes.Tx in a fallbackTx struct that implements
sdk.Tx, sdk.FeeTx, sdk.HasValidateBasic, sdk.TxWithMemo, and
sdk.TxWithTimeoutHeight via lazy codec-based Any resolution.

Files:
- app/tx_decoder.go (new): CustomTxDecoder, fallbackDecode, fallbackTx
- app/app.go (modified): Wire custom decoder into baseapp.NewBaseApp
@vNodesV
vNodesV marked this pull request as draft July 18, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant